/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dal.util;

import java.util.Comparator;
import models.Messenger;

/**
 *
 * @author gabrielle
 */
public class MessageComparator implements Comparator<Messenger>
{

    @Override
    public int compare(Messenger t, Messenger t1) 
    {
        if(t.getDate().equals(t1.getDate()))
        {
            return 0;
        }
        if(t.getDate().before(t1.getDate()))
        {
            return 1;
        }
        if(t.getDate().after(t1.getDate()))
        {
            return -1;
        }
        return 0;
    }
    
}
